package com.earthchen.demo.domain;

import com.baomidou.mybatisplus.annotations.TableName;
import com.earthchen.core.domain.SuperEntity;

import javax.validation.constraints.NotEmpty;

/**
 * 资源实体
 *
 * @author earthchen
 */
@TableName("sys_resource")
public class SysResource extends SuperEntity<SysResource> {

    @NotEmpty
    private String code;

    @NotEmpty
    private String name;

    private Long parentId;

    @NotEmpty
    private String uri;

    private Short type;

    private String method;

    private String icon;

    @NotEmpty
    private Short status;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code == null ? null : code.trim();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getUri() {
        return uri;
    }

    public void setUri(String uri) {
        this.uri = uri == null ? null : uri.trim();
    }

    public Short getType() {
        return type;
    }

    public void setType(Short type) {
        this.type = type;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method == null ? null : method.trim();
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon == null ? null : icon.trim();
    }

    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "Resource{" +
                "code='" + code + '\'' +
                ", name='" + name + '\'' +
                ", parentId=" + parentId +
                ", uri='" + uri + '\'' +
                ", type=" + type +
                ", method='" + method + '\'' +
                ", icon='" + icon + '\'' +
                ", status=" + status +
                '}';
    }
}